﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="CompanyView.aspx.cs" Inherits="Main_Company_CompanyView" %>
<%@ Register Src="~/User Controls/PageHeading.ascx" TagName="heading" TagPrefix="acc" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
    <link href="../../Styles/accounts.css" rel="Stylesheet" type="text/css" />
    <script type="text/javascript" language="javascript">
      function openCompanyDetail(compid)
        {
            window.open("CompanyDetail.aspx?compid=" + compid, "_blank", "toolbar=0,scrollbars=yes,resizable=yes,maximize=1");
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div class ="divmain">
       <div class="divmain">
       
                      <acc:heading ID="pagehead" runat="server" HeadingText="Item Master -> Edit" />       
        </div>
       
       <%-- <asp:GridView ID="GridCompanyView" runat="server" CssClass="gridview" EmptyDataText="No Record Found !" EmptyDataRowStyle-CssClass="emptyrow"
            AllowPaging="true" AutoGenerateColumns="false" PageSize="10"  DataKeyNames="CompId"
            onpageindexchanging="GridCompanyView_PageIndexChanging" onselectedindexchanged="GridCompanyView_SelectedIndexChanged" >
        
            <Columns>
                <asp:TemplateField HeaderText="S.No" >
                    <ItemTemplate><%#Container.DataItemIndex+1%></ItemTemplate>    
                </asp:TemplateField>
                <asp:BoundField HeaderText="Company Name" DataField="CompName" />
                <asp:BoundField HeaderText="Trading Name" DataField="TradingName" />
                <asp:BoundField HeaderText="Type Of Buisness" DataField="BType" />
                <asp:BoundField HeaderText="Status" DataField="Status"  />
                <asp:BoundField HeaderText="Accounting" DataField="IsAccEnabled" />
                <asp:BoundField HeaderText="Invoicing" DataField="IsInvcEnabled" />
                <asp:BoundField HeaderText="Inventory" DataField="IsInvrEnabled" />
                <asp:BoundField HeaderText="Accounting Year Starting" DataField="BooksFromDate" DataFormatString="{0:dd-MMM-yy}" />
                <asp:BoundField HeaderText="Last Day Of Accounting Period" DataField="BooksEndDate" DataFormatString="{0:dd-MMM-yy}" />  
                <asp:TemplateField HeaderText="View">
                    <ItemTemplate><asp:HyperLink ID="hypview" ImageUrl="~/Menu/images/Views.png" Text="View" onclick='<%#Eval("compid","openCompanyDetail({0})")%>' NavigateUrl="#" runat="server"></asp:HyperLink></ItemTemplate>
                </asp:TemplateField>                    
                 <asp:CommandField HeaderText="Edit" SelectText="<img src='../../Menu/images/Edit_user.png'>" ShowSelectButton="true" />   
                 
                 
            </Columns>
            <PagerStyle HorizontalAlign="Right" />
        </asp:GridView>--%>
        <div style="margin-left:30%; margin-right:30%; width:40%; ">
        <asp:GridView ID="gridviewcompany" runat="server" CssClass="gridview"  AlternatingRowStyle-CssClass="gridview_alternate"
           EmptyDataText="No Record Found !" EmptyDataRowStyle-CssClass="emptyrow" 
            AllowPaging="true" PageSize="10" AutoGenerateColumns ="false" onrowcommand="gridviewcompany_RowCommand">
       <Columns>
         <asp:TemplateField HeaderText="S.no" >
            <ItemTemplate><%#Container.DataItemIndex+1%></ItemTemplate>
         </asp:TemplateField>
            <asp:BoundField HeaderText="Company Name" DataField="companyname" />            
            <asp:TemplateField HeaderText ="Open Company">
                <ItemTemplate> <asp:LinkButton  ID="Lnkbtn" runat="server" CommandArgument='<%#Eval("companyname")%>' 
                CommandName="opencompany" Text="open"  alt="open" ></asp:LinkButton> 
               </ItemTemplate>
            </asp:TemplateField>
         </Columns>                    
        </asp:GridView>
        </div>
   
    </div>
    </form>
</body>
</html>
